#import "FoursquareFriendAnnotation.h"

/**
 * A FoursquareFriendAnnotation is a single friend check-in in the 
 * Foursquare system represented as a map annotation for an MKMapView. 
 * 
 * @author      James Lin
 * @version     2.3.4
 * @since       2.3.4
 * @see         AddressAnnotation
 */
@implementation FoursquareFriendAnnotation

@synthesize friendShout;         // Shout by friend
@synthesize friendUserImageURL;  // URL of image of friend 
@synthesize friendCheckInDate;   // Timestamp of check-in
@synthesize venueInfo;           // Info for the friend location

/**
 * Initialize the Foursquare friend annotation.
 *
 * @param venue      the Foursquare venue of the friend check-in
 * @param shout      the shout by friend
 * @param imageURL   URL of image of friend
 * @param date       date timestamp of friend check-in
 * @return           the initialized Foursquare friend annotation
 */
- (id)initWithVenue:(FoursquareVenue*)venue 
			  shout:(NSString*)shout
		   imageURL:(NSString*)imageURL
			   date:(NSString*)date {
	if (self = [super initWithType:AnnotationTypeFoursquareFriend]) {
		self.venueInfo = venue;
		self.friendShout = shout ? shout : @"";
		self.friendUserImageURL = imageURL;
		self.friendCheckInDate = date;
		[super setCoordinate:venue.venueLocation];
		[super setSubtitle:venue.venueName];
	}
	
	return self;
}

/**
 * Deallocate the Foursquare friend annotation.
 */
- (void)dealloc {
	[friendShout release], friendShout = nil;
	[friendUserImageURL release], friendUserImageURL = nil;
	[friendCheckInDate release], friendCheckInDate = nil;
	[venueInfo release], venueInfo = nil;
	[super dealloc];
}
@end
